<form action="{% url 'forms:contact' %}" method="post">
    {% csrf_token %}
    <!-- 自动渲染 -->
    <!-- {{ form.non_field_errors }} -->
    <!-- {{ form.as_table }} -->
    <!-- {{ form.as_p }} -->
    <!-- {{ form.as_ul }} -->

    <!-- 手动渲染 -->
    {% if form.subject.errors %}
        <ol>
        {% for error in form.subject.errors %}
            <li><strong>{{ error|escape }}</strong></li>
        {% endfor %}
        </ol>
    {% endif %}
    <div class="fieldWrapper">
        {{ form.subject.errors }}
        {{ form.subject.label_tag }}
        {{ form.subject }}
    </div>
    <div class="fieldWrapper">
        {{ form.message.errors }}
        <label for="{{ form.message.id_for_label }}">Your message:</label>
        {{ form.message }}
    </div>
    <div class="fieldWrapper">
        {{ form.sender.errors }}
        <label for="{{ form.sender.id_for_label }}">Your email address:</label>
        {{ form.sender }}
    </div>
    <div class="fieldWrapper">
        {{ form.cc_myself.errors }}
        <label for="{{ form.cc_myself.id_for_label }}">CC yourself?</label>
        {{ form.cc_myself }}
    </div>
    <input type="submit" value="Submit" />
</form>




